"use cilent";
import { ProColumns, ProTable } from "@ant-design/pro-components";
import { Modal } from "antd";
import React from "react";

interface Props {
  isModalOpen: boolean;
  columns?: ProColumns<API.QuestionVO>[];
  onCancel?: () => void;
}
/**
 * 创建弹窗
 * @returns
 */
const DetailModal: React.FC<Props> = (props: Props) => {
  const { isModalOpen, columns, onCancel } = props;

  return (
    <>
      <Modal
        title="查看"
        closable={{ "aria-label": "Custom Close Button" }}
        open={isModalOpen}
        onCancel={() => onCancel?.()}
        centered={true}
        footer={null}
      >
        <ProTable type="form" columns={columns} />
      </Modal>
    </>
  );
};
export default DetailModal;
